package com.autoTools.view;

import java.util.HashMap;

import com.autoTools.util.LogUtil;

public class BaseView
{
	private BaseView mParent = null;
	private Object mInstance = null;
	private HashMap<String,String> mProperty = new HashMap<String, String>();
	private HashMap<String,String> mAction = new HashMap<String, String>();
	static final String TAG = "BaseView";
	
	public void BaseInit(Object instance){
		mInstance = instance;
	}
	
	public Object getInstance()
	{
		return mInstance;
	}
	
	public HashMap<String, String> getProperty()
	{
		return mProperty;
	}

	public BaseView getParent()
	{
		return mParent;
	}

	public boolean setParent(BaseView parent)
	{
		if(this.mParent == null){
			this.mParent = parent;
			return true;
		}else{
			LogUtil.sysLog(TAG, "Error:this BaseView have a parent already");
			return false;
		}
	}
	
	public boolean addChild(BaseView child){
		if(child != null){
			return child.setParent(this);
		}else{
			return false;
		}
	}
	
	public void addItem(Object ...child){
		
	}
	
	public void setLabel(String label){
		
	}
	
	public void setAction(String name,String value){
		mAction.put(name, value);
	}
	
	public String getActionCommand(String action){
		return mAction.get(action);
	}
	
	public void setColumn(String value){
		
	}
	
}
